#!/bin/sh
set -e

#DEBHELPER#

#only enable on installation not upgrade
if [ "$1" = configure ] && [ -z "$2" ]; then
	if [ -f /etc/fwupd/fwupd.conf ]; then
		if [ "$CI" = "true" ]; then
			sed "s,^DisabledPlugins=.*,DisabledPlugins=," -i /etc/fwupd/fwupd.conf
			sed "s,^AllowEmulation=false,AllowEmulation=true," -i /etc/fwupd/fwupd.conf
		else
			echo "To enable test suite, modify /etc/fwupd/fwupd.conf"
		fi
	fi
	if [ -f /etc/fwupd/remotes.d/fwupd-tests.conf ]; then
		if [ "$CI" = "true" ]; then
			sed "s,^Enabled=false,Enabled=true," -i /etc/fwupd/remotes.d/fwupd-tests.conf
		else
			echo "To enable test suite, enable fwupd-tests remote"
		fi

	fi
fi
